<?php

namespace pam\Factory;

/**
 * Description of AgeingPolicyControllerFactory
 *
 * @author Robert Bwana
 */

use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use pam\Controller\AgeingPolicyController;


class AgeingPolicyControllerFactory implements FactoryInterface{
    public function createService(ServiceLocatorInterface $serviceLocator) {
            $policyLocator = $serviceLocator->getServiceLocator();
            $ageingPolicyService = $policyLocator->get('pam\Service\AgeingPolicyService');
            $policyService = $policyLocator->get('pam\Service\PolicyService');
            $form = $policyLocator->get('FormElementManager')->get('pam\Form\AgeingPolicyStatementForm');
            $policyForm = $policyLocator->get('FormElementManager')->get('pam\Form\PolicyForm');
            
            return new AgeingPolicyController($ageingPolicyService, $policyService, $form, $policyForm);
        }

}
